package com.gxa.admin.recycling.service.impl;

import com.gxa.admin.recycling.mapper.RolePermissionMapper;
import com.gxa.admin.recycling.service.RolePermissionService;
import com.gxa.core.recycling.pojo.Rolepermission;
import com.gxa.core.recycling.service.impl.BaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author R
 * @data 2021-12-02 15:46
 */
@Service
public class RolePermissionServiceImpl extends BaseServiceImpl<Rolepermission> implements RolePermissionService {

    @Autowired
    RolePermissionMapper mapper = null;

    @Override
    public void insert(Integer rid, List<Integer> oids) {
        for (Integer oid : oids) {
            mapper.add(rid,oid);
        }
    }

    @Override
    public void deleteByRid(Long rid) {
        mapper.deleteByRid(rid);
    }
}
